package cn.iocoder.yudao.module.exam.dal.mysql.uploadbatch;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.exam.dal.dataobject.uploadbatch.UploadBatchDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.exam.controller.admin.uploadbatch.vo.*;

/**
 * 终端管理 Mapper
 *
 * @author Francis
 */
@Mapper
public interface UploadBatchMapper extends BaseMapperX<UploadBatchDO> {

    default PageResult<UploadBatchDO> selectPage(UploadBatchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UploadBatchDO>()
                .eqIfPresent(UploadBatchDO::getBatchCode, reqVO.getBatchCode())
                .likeIfPresent(UploadBatchDO::getExamName, reqVO.getExamName())
                .eqIfPresent(UploadBatchDO::getSubject, reqVO.getSubject())
                .eqIfPresent(UploadBatchDO::getGrade, reqVO.getGrade())
                .eqIfPresent(UploadBatchDO::getTotalCount, reqVO.getTotalCount())
                .eqIfPresent(UploadBatchDO::getUploadStatus, reqVO.getUploadStatus())
                .orderByDesc(UploadBatchDO::getId));
    }

}